package com.dousb.oj.judge.codesandbox.impl;


import com.dousb.oj.exception.BusinessException;
import com.dousb.oj.judge.codesandbox.CodeSandbox;
import com.dousb.oj.judge.codesandbox.model.ExecuteCodeRequest;
import com.dousb.oj.judge.codesandbox.model.ExecuteCodeResponse;
import com.dousb.oj.judge.codesandbox.model.JudgeInfo;
import com.dousb.oj.model.enums.JudgeInfoMessageEnum;
import com.dousb.oj.model.enums.QuestionSubmitStatusEnum;

import java.util.List;



/**
 * ExampleCodeSandbox
 *
 * @author 豆沙包
 * @version 1.0
 * @since 2025-11-01  15:10
 */

public class ExampleCodeSandbox implements CodeSandbox {
    /**
     * 执行代码
     *
     * @param executeCodeRequest 请求参数
     * @return 执行结果
     */
    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        List<String> inputList = executeCodeRequest.getInputList();
        ExecuteCodeResponse executeCodeResponse = new ExecuteCodeResponse();
        executeCodeResponse.setOutputList(inputList);
        executeCodeResponse.setMessage("测试执行成功");
        executeCodeResponse.setStatus(QuestionSubmitStatusEnum.SUCCEED.getValue());
        JudgeInfo judgeInfo = new JudgeInfo();
        judgeInfo.setMessage(JudgeInfoMessageEnum.ACCEPTED.getValue());
        judgeInfo.setMemory(100L);
        judgeInfo.setTime(100L);
        executeCodeResponse.setJudgeInfo(judgeInfo);
        return executeCodeResponse;
    }
}